-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use protobufs to store confirmed blocks in BigTable #12526
Conversation
TODO:
|
eb51be5
to
39f5ade
Compare
Here are the bigtable rows read out using
I'm not sure how to translate this to raw bytes, but length of the string encoded values is roughly the same 🤷 |
@@ -0,0 +1,67 @@ | |||
syntax = "proto3"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer this layout:
storage-bigtable/src/confirmed_block.proto
storage-bigtable/proto/confirmed_block.rs
- keeping generated files out of
src/
in general feels best, as we unleash linters and formatters onsrc/
. - No need for
src/proto/blah.proto
in this case,src/blah.proto
is just as good since the number of files in this crate is small - I'm not a superfan of
storage-bigtable/proto/...
as the location for generated protobuf source files, but I guess it works and it's notsrc/
|
||
message Reward { | ||
string pubkey = 1; | ||
int64 lamports = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fun fact: I'm already thinking about adding a new field to this struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post_balance
from this PR: #12561
Codecov Report
@@ Coverage Diff @@
## master #12526 +/- ##
========================================
Coverage 82.0% 82.0%
========================================
Files 356 357 +1
Lines 83140 83390 +250
========================================
+ Hits 68197 68461 +264
+ Misses 14943 14929 -14 |
39f5ade
to
661eff3
Compare
661eff3
to
3ae2d33
Compare
3ae2d33
to
0625a9e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks amazing overall. Super happy to see protobuf sneaking in more!
storage-bigtable/src/utils.rs
Outdated
@@ -0,0 +1,291 @@ | |||
use solana_sdk::{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic file/directory names like "utils" are pretty triggering for me. Maybe this can be called from.rs
? convert.rs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way better. Thanks!
Pull request has been modified.
* Use protobufs to store confirmed blocks in BigTable * Cleanup * Reorganize proto * Clean up use statements * Split out function for unit testing * s/utils/convert Co-authored-by: Tyera Eulberg <[email protected]> (cherry picked from commit ce598c5)
* Use protobufs to store confirmed blocks in BigTable * Cleanup * Reorganize proto * Clean up use statements * Split out function for unit testing * s/utils/convert Co-authored-by: Tyera Eulberg <[email protected]> (cherry picked from commit ce598c5) Co-authored-by: Justin Starry <[email protected]>
Problem
Data is stored in BigTable using bincode serialization which is not versioned and does not allow extending nested structs.
Summary of Changes
storage-bigtable
to store protobuf serialized data"proto"
"bin"
cell data if"proto"
was not foundFixes #12494